import axios from '@/utils/request.js'

export const userLogin = (data) => {
  return axios({
    method: 'post',
    url: '/login',
    data
  })
}
export const userRegister = (data) => {
  return axios({
    method: 'post',
    url: '/register',
    data
  })
}

export const getUserDeil = (id) => {
  return axios({
    url: `/user/${id}`,
    // headers: {
    //   Authorization: localStorage.getItem('hmtt_token')
    // }
  })
}

export const editUser = (id, data) => {
  return axios({
    method: 'post',
    url: `/user_update/${id}`,
    data
  })
}


export const fllowsUser = (id) => {
  return axios({
    url: `/user_follows/${id}`,

  })
}

//  取消关注
export const unFllowsUser = (id, data) => {
  return axios({
    url: `/user_unfollow/${id}`,
  })
}

// 用户关注列表
export const getFollows = () => {
  return axios({
    url: '/user_follows'
  })
}

// 收藏列表
export const getStarList = () => {
  return axios({
    url: '/user_star'
  })
}